﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.XPath;
using System.Xml;
using System.Configuration;
using System.Web.Security;
using System.Data;

namespace project_web2.FactoryAPI {

    
    public class xmlDataAdminToolMenu {

        public static DataTable loadAdminToolMenu(XmlDocument xml) {
                DataTable dt = new DataTable();
                dt.Columns.Add("id");
                dt.Columns.Add("name");
                dt.Columns.Add("path");
                XmlNode Node = xml.SelectSingleNode("/data/memus");
                if (Node != null) {
                    for (int i = 0; i < Node.ChildNodes.Count; i++) {
                        DataRow dr = dt.NewRow();
                        dr["id"] = Node.ChildNodes[i].Attributes["id"].Value;
                        dr["name"] = Node.ChildNodes[i].Attributes["name"].Value;
                        dr["path"] = Node.ChildNodes[i].Attributes["path"].Value;
                        dt.Rows.Add(dr);
                    }
                }
                return dt;
        }


    }


}